package com.wyz.easyexcel;

import org.springframework.boot.SpringApplication;
import org.springframework.boot.autoconfigure.SpringBootApplication;
import org.springframework.context.ConfigurableApplicationContext;

/**
 * @author wyz
 * @description: 启动类
 * @date 2021/12/28 14:13
 */

@SpringBootApplication
public class Application {

    private static ConfigurableApplicationContext applicationContext;

    public static void main(String[] args) {
        applicationContext  = SpringApplication.run(Application.class, args);
    }

    /**
     *  根据class 获取容器中的对象
     * @param tClass
     * @param <T>
     * @return
     */
    public static <T> T getBean(Class<T> tClass){

        return applicationContext.getBean(tClass);
    }

}
